<!--
 * @Description: jQuery
 * @Author: rendc
 * @Date: 2021-09-10 09:52:51
 * @LastEditors: rendc
 * @LastEditTime: 2021-09-10 10:01:00
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>jQuery</title>
  <!-- 导入jQuery -->
  <script src="../js/jquery.js"></script>
</head>

<body>
  <button>按钮</button>
</body>
<script>
  // 文档就绪事件
  // $(document).ready(
  //   function () {
  //     var btn = $('button');
  //     console.log(btn);
  //   }
  // )
  // 匿名函数 等同于上面的文档就绪事件
  $(function () {
    var btn = $('button');
    console.log(btn);
  })
</script>

</html>